package decorator;

/**
 * @author dongtao
 * @desc 测试
 * @Data 2021-08-15
 */
public class Test {
    public static void main(String[] args) {
        // 选择咖啡
        Component coffee = new ConcreteComponent();
        // 加牛奶
        coffee = new ConcreteDecorator1(coffee);
        // 加摩卡
        coffee = new ConcreteDecorator2(coffee);
        // 输出
        System.out.println(coffee.getDescription() + "\n总价:" + coffee.getPrice());
    }
}
